package org.dromara.business.enums;

import lombok.Getter;

/**
 * 通知类型枚举
 */
@Getter
public enum NotificationType {
    
    /**
     * 大额交易提醒
     */
    LARGE_TRANSACTION("large_transaction", "🚨", "大额交易提醒"),
    
    /**
     * 小时统计报告
     */
    HOURLY_STATISTICS("hourly_statistics", "📊", "小时统计报告"),
    
    /**
     * 日统计报告
     */
    DAILY_STATISTICS("daily_statistics", "📈", "日统计报告"),
    
    /**
     * 系统异常告警
     */
    SYSTEM_ALERT("system_alert", "⚠️", "系统异常告警"),
    
    /**
     * 交易失败提醒
     */
    TRANSACTION_FAILED("transaction_failed", "❌", "交易失败提醒"),
    
    /**
     * 网络连接异常
     */
    NETWORK_ERROR("network_error", "🌐", "网络连接异常"),
    
    /**
     * 余额不足提醒
     */
    INSUFFICIENT_BALANCE("insufficient_balance", "💳", "余额不足提醒"),
    
    /**
     * 合约事件通知
     */
    CONTRACT_EVENT("contract_event", "📋", "合约事件通知"),
    
    /**
     * 维护通知
     */
    MAINTENANCE("maintenance", "🔧", "维护通知"),
    
    /**
     * 普通信息
     */
    INFO("info", "ℹ️", "信息通知");
    
    private final String code;
    private final String emoji;
    private final String description;
    
    NotificationType(String code, String emoji, String description) {
        this.code = code;
        this.emoji = emoji;
        this.description = description;
    }
    
    public static NotificationType fromCode(String code) {
        for (NotificationType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return INFO;
    }
}